﻿
<script type="text/javascript">


function load() { 

    var requestTemplate = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' +
    '<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">' +
    '<soap:Header>' +
    '<AuthHeader xmlns="http://InternetServices/WebServices/">' +
    '<Username>MyName</Username>' +
    '<Password>MyPassword</Password>' +
    '</AuthHeader>' +
    '</soap:Header>' +
    '<soap:Body>' +
    '<CustomerWS xmlns="http://InternetServices/WebServices/" />' +
    '</soap:Body>' +
    '</soap:Envelope>';

    var queryValues = {};
    queryValues['op'] = 'CustomerWS';
    queryValues['parameters'] = requestTemplate;
    var request = new Sys.Net.WebRequest();
    request.get_headers()['Content-Type'] = 'application/json; charset=utf-8';
    var path = 'http://win-e5bw5cnnmxw/_catalogs/masterpage/WebservicePagelayout.aspx' + '?' + Sys.Net.WebRequest._createQueryString(queryValues, null);
    request.add_completed(handleRequestComplete);
    request.set_url(path);
    request.invoke();  


} 


function handleRequestComplete(response, userContext) 
{
debugger;
     var test = response;
    alert (response.get_object()); 
}

Sys.Application.add_load(load); 

</script>